//
//  ACPhotoManager.h
//  ACFramework
//
//  Created by caoyq on 2018/6/29.
//

#import <Foundation/Foundation.h>

/**
 统一图片的管理
 
 - 存储image和gif
 - 存储网络image和gif，先用SDWebImage第三方进行下载，再进行保存（gif保存功能只在 iOS11 及以上版本生效）
 */
@interface ACPhotoManager : NSObject

///单例
+ (instancetype)manager;

/**
 纯保存图片

 @param image   UIImage 实例
 @param completion 回调 error = nil  is success, otherwise failure.
 */
- (void)saveImage: (UIImage *)image completion: (void(^)(NSError *error))completion;

/**
 保存图片和gif

 @param image      UIImage 实例
 @param completion 回调 error = nil  is success, otherwise failure.
 */
- (void)saveImageContainGIF: (UIImage *)image completion: (void(^)(NSError *error))completion;

/**
 保存网络图片和gif

 @param imageURL  NSString 实例
 @param completion 回调 error = nil  is success, otherwise failure.
 */
- (void)saveImageURLContainGTF: (NSString *)imageURL completion: (void(^)(NSError *error))completion;

/**
 保存图片和gif的data

 @param photoData NSData 实例
 @param completion 回调 error = nil  is success, otherwise failure.
 */
- (void)savePhotoContainGIF: (NSData *)photoData completion: (void(^)(NSError *error))completion;

@end
